from Globals import *
streams = {
'radio2': 'http://mp3.streampower.be/ra2vlb-high.mp3',
'klara':'http://mp3.streampower.be/klara-high.mp3',
'stubru' : 'http://mp3.streampower.be/stubru-high.mp3',
'studio brussel' : 'http://mp3.streampower.be/stubru-high.mp3',
'mnm' : 'http://mp3.streampower.be/mnm-high.mp3',
'radiovlaanderen' : 'http://mp3.streampower.be/rv-high.mp3 ',
'radio1' :  'http://mp3.streampower.be/radio1-high.mp3',
'nostalgie' : 'http://director.nostalgie.eu/app/audio/nostalgie/windowsmediaplayer/'
}

def run():
	'''
	Simpele plug-in die enkele radio-streams van Belgie bevat. Luistert op het commando stream {radionaam}.
	'''
	global hook
	print "[STREAMING] Hellow!"
	hook.registerHook('unhandledCommand_before', handleCommand)

def handleCommand(args):
	match = re.match('^stream ([a-z0-9]+)(\n|\r){0,}$',args['data'],re.IGNORECASE)
	if match and match.group(1) in streams:
		print streams[match.group(1)]
		hook.main.playSongFromFile(streams[match.group(1)])


